package cn.dnui_xcz826.dnuifood_16110100826.model;


import android.app.Service;

import cn.dnui_xcz826.dnuifood_16110100826.controller.Constants;
import cn.dnui_xcz826.dnuifood_16110100826.iface.ShopIface;
import cn.dnui_xcz826.dnuifood_16110100826.listener.onRetrofitListener;
import cn.dnui_xcz826.dnuifood_16110100826.service.ShopService;
import retrofit2.Call;

/**
 * Created by neusoft on 2018/10/29.
 */

public class ShopModel extends BaseModel  implements ShopIface {
    private ShopService service;
    public ShopModel() {
        service = retrofit.create(ShopService.class);
    }

    @Override
    public void getAllShops(final onRetrofitListener listener) {
        Call call = service.getAllShops();
        bindCallback(call, listener, Constants.GETALLSHOPS);
    }
    @Override
    public void getFoodByShop(String shop_id, onRetrofitListener listener) {
        Call call=service.doGetFoodByShop(shop_id);
        bindCallback(call,listener, Constants.GETFOODBYSHOP);
    }

    @Override
    public void getShopById(String shop_id, onRetrofitListener listener) {
        Call call=service.doGetShopById(shop_id);
        bindCallback(call,listener,Constants.GETSHOPBYID);
    }
}
